<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

</head>

<body>
    <div>333</div>
    <p>
        abc
        <span>111
            <span>444</span>
        </span>
        <span>222</span>
    </p>

    <script>
        /* 
            innerText和innerHTML的区别：            
        */
        const divObj = document.querySelector("div")
        // console.dir(divObj.innerHTML)
        // console.dir(divObj.innerText)
        const pObj = document.querySelector("p")
        console.dir(pObj)
        /* 
            innerText:显示标签内（包含所有子元素的）的文本元素
         */
        console.log(pObj.innerText)
        /* 
            innerHTML：Element.innerHTML 属性设置或获取 HTML 语法表示的元素的后代。
         */
        console.log(pObj.innerHTML)
    </script>
</body>

</html>